package info.ask4research.model.addons;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;


@JsonAutoDetect
@Entity
@Table(name="Question")
public class Question {

	@Id
	@GeneratedValue
	@Column(name="addon_ID")
	private int id;
	@Column(name="question")
	private String question;
	@LazyCollection(LazyCollectionOption.FALSE)
	@OneToMany
	@JoinColumn(name="question_ID", referencedColumnName="addon_ID")
	private List<Answer> answers = new ArrayList<Answer>();

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public List<Answer> getAnswers() {
		return answers;
	}

	public void setAnswers(List<Answer> answers) {
		this.answers = answers;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	

	
}
